% code style
%
% Copyright(C) 2013, yanyg<yygcode@gmail.com>
%

\usepackage{listings}
\usepackage[dvipsnames,svgnames,x11names]{xcolor}

% C language
% ref~ to listings.pdf and xcolor.pdf
% howto:
%
\lstdefinestyle{c}
{
	language=C,
	%
	% basic style
	basicstyle=\ttfamily\small,
	identifierstyle=\color{MediumBlue},
	stringstyle=\itshape,
	keywordstyle=\color{LimeGreen},
	%
	% [[:space:]]
	tabsize=8,
	showtabs=false,
	showspaces=false,
	breaklines=true,
	%
	% line number
	numbers=left,
	numberstyle=\tiny\color{Indigo},
	numberblanklines=true,
	%
	% frame
	aboveskip=.3em,
	belowskip=.3em,
	lineskip=-.2em,
	backgroundcolor=\color{Lavender},
	frame=single,
	framerule=.8pt,
	framextopmargin=.3em,
	framexleftmargin=2.5em,
	framexrightmargin=0em,
	rulecolor=\color{Silver},
	%
	%
	% commentstyle=\itshape\color[RGB]{64,128,192},
	morecomment=[s][\color{DarkViolet}]{/**}{*/},
	morecomment=[s][\itshape\color{violet}]{/*\ <good-style>}{*/},
	morecomment=[s][\itshape\color{red}]{/*\ <bad-style>}{*/},
	%
	% include directive
	morecomment=[s][\color{purple}]{\#include\ <}{>},
	% common macros, treat as emph
	emphstyle={[10]\color{Red}},
	emph={[10]assert,NULL,EINTR},
	%
	% C99 types
	morekeywords={size_t,ssize_t},
	% end
}
